<script>
import {getUser} from "../../utils/utils";

export default {
  name: "PointsCenter",
  data(){
    return{
      user:{},
      wallet:{},
      dialogVisible:false,
    }
  },
  methods:{
    getMoney(){
      this.dialogVisible=true
    },
    getWallet(){
      this.$axios.get('user/getWallet?userId='+this.user.id).then(resp=>{
        this.wallet=resp.data.data
      })
    }
  },
  created() {
    this.user=getUser()
    this.getWallet()
  }
}
</script>

<template>
<div>
  <h1>您的余额：<span style="color: aqua">{{wallet.balance}}</span>￥&nbsp;&nbsp;&nbsp;您的积分：<span style="color: aqua">{{wallet.point}}</span> </h1>
  <el-button type="success" @click="getMoney">提现</el-button>
  <el-dialog
    title="提现"
    :visible.sync="dialogVisible"
    width="30%">

    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</div>
</template>

<style scoped>

</style>
